;
! function() {
	//点击审核
	$(document).on("click", ".audit", function() {
		var front = $(".front").attr("src");
		var back = $(".back").attr("src");
		var attachement = $(".attachement").attr("src");
		var id = $("#id").html();
		var audit = $(this).attr("id");
		var type = "";
		if(audit == 2) {
			if(front != "" && back != "") {
				type = "0";
			} else if(attachement != "") {
				type = "1";
			} else {
				return false;
			}
		}
		// prompt层
		layer.prompt({
			title: '提交审核意见',
			formType: 2
		}, function(text, index) {
			layer.close(index);
			layer.confirm('确定提交吗?', {
				icon: 3,
				title: '温馨提示'
			}, function(index) {
				$.ajax({
					url: "/secuser/auditRealName",
					type: "post",
					data: {
						"id": id,
						"audit": audit,
						"type": type,
						"text": text
					},
					success: function(result) {
						if(result.status == 0) {
							parent.location = "/";
						} else {
							layer.msg("提交失败");
						}
						layer.close(index);
					}
				});
			});
		});
	});
}();